<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
export default {
  name: 'App',
  mounted() {
    window.addEventListener('unload', this.saveState);
  },
  methods: {
    saveState() {
      sessionStorage.setItem('state', JSON.stringify(this.$store.state));
      sessionStorage.setItem('token', this.$store.token);
    }
  }
}
</script>

<style>
#app {
  text-align: center;
  height: 100%;
}
  body,html{
    margin: 0;
    padding: 0;
    height: 100%;
  }
</style>
